{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "caf76643-cbe3-49e9-8889-7a213180b72a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "类型为int32: [[11 13 18]\n",
      " [45 46 78]\n",
      " [15 87 33]]\n",
      "维度: 2 数组形状: (3, 3) 元素总数: 9 数据类型: int32\n",
      "第2行，第3列的元素: 78\n",
      "第2行、列步长为2的元素: [45 78]\n",
      "第1~2行、第2~3列的元素: [[13 18]\n",
      " [46 78]]\n",
      "第1行第2列、第2行第3列的元素: [13 78]\n",
      "大于30小于80的元素: [45 46 78 33]\n",
      "等差数列: [ 5. 14. 23. 32. 41. 50.] 公差: 9.0\n",
      "等比数列: [1.00000000e+00 5.79954613e+00 3.36347354e+01 1.95066200e+02\n",
      " 1.13129542e+03 6.56100000e+03]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "arr = np.array([[11,13,18],[45,46,78],[15,87,33]], dtype=np.int32)\n",
    "print(\"类型为int32:\",arr)\n",
    "print(\"维度:\", arr.ndim,\"数组形状:\", arr.shape,\"元素总数:\", arr.size,\"数据类型:\", arr.dtype)\n",
    "print(\"第2行，第3列的元素:\", arr[1,2])\n",
    "print(\"第2行、列步长为2的元素:\", arr[1,::2])\n",
    "print(\"第1~2行、第2~3列的元素:\", arr[:2,1:3])\n",
    "print(\"第1行第2列、第2行第3列的元素:\", arr[[0,1],[1,2]])\n",
    "print(\"大于30小于80的元素:\", arr[(arr>30)&(arr<80)])\n",
    "l = np.linspace(5,50,6)\n",
    "print(\"等差数列:\", l, \"公差:\", l[1]-l[0])\n",
    "print(\"等比数列:\", np.logspace(0,8,6,base=3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1d867eca-95f2-41af-8b96-a38d33f21cd7",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
